﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.WebInfo
{
    public class LeaveMsg
    {
        public int MsgID { get; set; }
        public int? TypeID { get; set; }
        public string TypeName { get; set; }
        public string MsgSubject { get; set; }
        public string MsgBody { get; set; }
        public bool? NeedContact { get; set; }
        public string ContactMan { get; set; }
        public string Mobile { get; set; }
        public string Email { get; set; }
        public string QQNum { get; set; }
        public string Keywords { get; set; }
        public DateTime CreateTime { get; set; }
        public bool? IsReply { get; set; }
        public bool? IsPublic { get; set; }
        public string Auditor { get; set; }

        public static LeaveMsg AsLeaveMsg(WI_LeaveMsg wilmsg, string msgTypeName)
        {
            LeaveMsg lmsg = new LeaveMsg
            {
                MsgID = wilmsg.MsgID,
                TypeID = wilmsg.TypeID,
                TypeName = msgTypeName,
                MsgSubject = wilmsg.MsgSubject,
                MsgBody = wilmsg.MsgBody,
                NeedContact = wilmsg.NeedContact,
                ContactMan = wilmsg.ContactMan,
                Mobile = wilmsg.Mobile,
                Email = wilmsg.Email,
                QQNum = wilmsg.QQNum,
                Keywords = wilmsg.Keywords,
                CreateTime = wilmsg.CreateTime,
                IsReply = wilmsg.IsReply,
                IsPublic = wilmsg.IsPublic,
                Auditor = wilmsg.Auditor
            };
            return lmsg;
        }
    }
}
